package com.zdkj.subway.stm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zdkj.subway.stm.dto.out.SwStOneWayStatisticsDTO;
import com.zdkj.subway.stm.entity.SwStOneWayStatistics;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 单程票流失率统计表
 *
 * @author cui_com
 * @date 2020-08-21 15:39:25
 */
public interface SwStOneWayStatisticsMapper extends BaseMapper<SwStOneWayStatistics> {

    /**
     * 按日期查流失率
     * @param page
     * @param endTime
     * @return
     */
    IPage<SwStOneWayStatisticsDTO> calcListPage(IPage page, @Param("startTime") String startTime, @Param("endTime") String endTime);


    /**
     * 根据日期查找当月的统计值
     * @param date
     * @return
     */
    List<SwStOneWayStatisticsDTO> calcData(@Param("dateString") String date);

    /**
     * 根据日期查找当月的统计值
     * @param startTime
     * @param endTime
     * @return
     */
    List<SwStOneWayStatisticsDTO> calcDatas(@Param("startTime") String startTime,@Param("endTime") String endTime);

    /**
     * 计算上月结存和本月结存
     * @param lineCode
     * @return
     */
    SwStOneWayStatisticsDTO calcPreMonthAmount(@Param("time") String time,@Param("lineCode") String lineCode);

}
